package com.dzl.fee;

import com.dzl.base.controller.BaseController;
import com.dzl.fee.pojo.query.WelfareSalesCustomersQuery;
import com.dzl.fee.service.WelfareSalesCustomersService;
import com.dzl.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 业务员客户关联
 * @date 2021/9/18 9:48
 * @author caobucao
 */
@RestController
@RequestMapping("/salesCustomers")
public class SalesCustomersController extends BaseController {

    @Autowired
    private WelfareSalesCustomersService service;

    /**
     * 联动查询业务员和客户
     * @date 2021/9/29 14:49
     * @author caobucao
     * @param query 查询条件
     * @return com.dzl.util.JsonResult<java.util.Map<java.lang.String,java.lang.Object>>
     */
    @GetMapping("/querySalesAndCustomers")
    public JsonResult<Map<String, Object>> querySalesAndCustomers(WelfareSalesCustomersQuery query) {
        query.setEnterpriseId(getAdminInfo().getEnterpriseId());
        return JsonResult.success(service.querySalesAndCustomers(query));
    }

}
